package classfile

import "math"

type ConstantLongInfo struct {
	Val int64
}

type ConstantDoubleInfo struct {
	Val float64
}

type ConstantFloatInfo struct {
	Val float32
}

type ConstantIntegerInfo struct {
	Val int32
}

func (self * ConstantLongInfo)ReadInfo(reader *ClassReader) {
	val := reader.ReadUint64()
	self.Val = int64(val)
}

func (self * ConstantDoubleInfo)ReadInfo(reader *ClassReader) {
	val := reader.ReadUint64()
	self.Val = math.Float64frombits(val)
}

func (self *ConstantIntegerInfo)ReadInfo(reader *ClassReader) {
	val := reader.ReadUint32()
	self.Val = int32(val)

}

func (self *ConstantFloatInfo)ReadInfo(reader *ClassReader) {
	val := reader.ReadUint32()	
	self.Val = math.Float32frombits(val)
}